<?php if(isset($success) && $success == 1 ){  ?>
        <div class="noty_bar noty_theme_default noty_layout_topCenter noty_success" id="noty_success_1355937644582" style="cursor: pointer; left: 559.5px; display: block;">
            <div class="noty_message"><span class="noty_text">Compañía creado con exito!</span></div>
        </div>
<?php }elseif(isset($success) && $success == 0){ ?>
<div class="noty_bar noty_theme_default noty_layout_topCenter noty_error hidden" id="message_error_formAddPurchase" style="cursor: pointer; left: 559.5px">
    <div class="noty_message"><span id="contentMessageErrorFormAddPurchase" class="noty_text"></span></div>
</div>
<?php } ?>
<?php if(isset($edit) && $edit == 1) { ?>
       <div class="noty_bar noty_theme_default noty_layout_topCenter noty_success" id="noty_success_1355937644582" style="cursor: pointer; left: 559.5px; display: block;">
            <div class="noty_message"><span class="noty_text">Compañía editado con exito!</span></div>
        </div> 
<?php } ?>






<div class="grid_container">

    <form id="formAddCompany" method="post" action="<?php echo base_url(); ?>index.php/company/submit" class="form_container"> 
		<div class="widget_wrap">
			<div class="widget_top">
				<span class="nav_icon admin_user_2"></span>
				<h6><?= isset( $company->id_company)? 'Editar':'Agregar'  ?> Companía</h6>
                                <?php
                                if(isset( $company->id_company))
                                {
                                    ?>
                                <input type="hidden" name="valor" id="valor" value="1">
                                <?php
                                }
                                ?>
			</div>
			<div class="widget_content">
				<ul>
                <li>
                    <div class="form_grid_12">
                        <label class="field_title" for="rs">Razón Social <span class="req">*</span></label>
                        <div class="form_input">
                            <input type="text" id="name" name="name" value="<?php echo @field($company->name, set_value('name')); ?>" class="noEmpty" tabindex="20">
                            
                        </div>
                    </div>
                </li>
                <li>
                    <div class="form_grid_12">
                        <label class="field_title" for="ruc">RUC</label>
                        <div class="form_input">
                            <?php
                            $data = array(
                                'name' => 'ruc',
                                'id' => 'ruc',
                                'class' => 'onlyNumber',
                                'maxlength' => 11,
                                'value' => @field($company->ruc, set_value('ruc')),
                                'tabindex' => '21'
                            );
                            echo form_input($data);
                            ?>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="form_grid_12">
                        <label class="field_title">Dirección</label>
                        <div class="form_input">
                            <?php
                            $data = array(
                                'name' => 'address',
                                'id' => 'address',
                                'value' => @field($company->address, set_value('address')),
                                'tabindex' => '22'
                            );
                            echo form_input($data);
                            ?>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="form_grid_12">
                        <label class="field_title">Teléfono</label>
                        <div class="form_input">
                            <?php
                            $data = array(
                                'name' => 'telephone',
                                'id' => 'telephone',
                                'class' => 'onlyNumber',
                                'onkeypress' => 'return isNumberKey(event)',
                                'value' => @field($company->telephone, set_value('telephone')),
                                'tabindex' => '23'
                            );
                            echo form_input($data);
                            ?>
                        </div>
                    </div>
                </li>
                <li>
                     <li>
                    <div class="form_grid_12">
                        <label class="field_title">Fecha</label>
                        <div class="form_input">
                            <?php
                            $data = array(
                                'name' => 'create',
                                'id' => 'create',
                                
                               
                                'value' => @field($company->create, set_value('create')),
                                'tabindex' => '24'
                            );
                            echo form_input($data);
                            ?>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="form_grid_12">
                        <label class="field_title">E-mail</label>
                        <div class="form_input">
                            <input type="text" name="email" id="email" class="email" value="<?php echo @field($company->email, set_value('email')); ?>" tabindex="25" placeholder="Email@4dominio.com">
                        </div>
                    </div>
                </li>
                
            </ul>
                       
               <?php echo form_hidden("id_company", @field(set_value('address'),$company->id_company)); ?>                                           
               <button style="margin-left: 20px; margin-bottom: 30px;" type="submit" class="btn_small btn_orange" id="boton_guardar_company"><span>Guardar</span></button>
               <?php  if(isset($company->id_company)){ ?>
               <a href="#"><button type="button" class="btn_small btn_orange" onclick="javascript:window.location='<?=base_url(); ?>index.php/company'"><span>Regresar</span></button></a>
               <?php } ?>               		
	</div>
  <span class="clear"></span>
</div>
</form>
                                    
        </div>       
